package dd.prog2.exercises.set07;

public class CuboidTank extends Tank{

	private double dimA, dimB, dimC;

	public CuboidTank(double a, double b, double c) {
		this.dimA = a;
		this.dimB = b;
		this.dimC = c;
		this.setType("Cuboid");
	}

	@Override
	public double calcSurface() {
		return (dimA*dimB+dimA*dimC+dimB*dimC);
	}

	@Override
	public double calcVolume() {
		return dimA*dimB*dimC;
	}

	public double getDimA() {
		return dimA;
	}

	public void setDimA(double dimA) {
		this.dimA = dimA;
	}

	public double getDimB() {
		return dimB;
	}

	public void setDimB(double dimB) {
		this.dimB = dimB;
	}

	public double getDimC() {
		return dimC;
	}

	public void setDimC(double dimC) {
		this.dimC = dimC;
	}

	@Override
	public String toString() {
		String res = "Cuboid Tank:\n";
		res += this.getType()+". Surface: "+df.format(this.calcSurface())+". Volume: "+df.format(this.calcVolume())+"\n";
		return res;
	}

	@Override
	protected CuboidTank clone() throws CloneNotSupportedException {
		CuboidTank t = new CuboidTank(this.dimA, this.dimB, this.dimC);
		return t;
	}

}
